package com.yu.controller;

import com.yu.mapper.GoodsMapper;
import com.yu.pojo.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController  //==@controll + @ResponseBody
public class GoodController {
    @Autowired
    private GoodsMapper goodMapper;

    @GetMapping("/goods") //url的请求都是 这个 类似 get请求 @RequestMapping  对应post
    public List<Goods> queryGoodsList () {
        List<Goods> goodList = goodMapper.queryGoodsList ();
        return goodList;
    }
}
